package com.example.main;

import android.support.annotation.NonNull;
import android.util.Log;

import org.json.JSONObject;

import java.io.File;

import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;

public class Main {

    public static void main(String[] args) {
//        System.out.println("dingjiahui");
//        ParseRegionUtil.readFile();
//        ReNameUtils.getFileName("C:\\Users\\EDZ\\Desktop\\djh\\数据翎\\官方信息调整\\官方信息调整\\官方信息图标\\彩色图标\\android\\风险信息\\yanzhongweifa_slices");
        System.out.println("ok1111");

        Observable<JSONObject> observable = Observable.create(new ObservableOnSubscribe<JSONObject>() {
            @Override
            public void subscribe(@io.reactivex.annotations.NonNull ObservableEmitter<JSONObject> emitter) throws Exception {
                emitter.onNext(null);
            }
        });

        observable//执行事件
                .subscribeOn(Schedulers.newThread())
                .observeOn(Schedulers.newThread())
                .subscribe(
                        new Consumer<JSONObject>() {
                            @Override
                            public void accept(JSONObject jsonObject) throws Exception {
                                System.out.println("ok222");
                            }
                        },
                        new Consumer<Throwable>() {
                            @Override
                            public void accept(Throwable throwable) throws Exception {
                                System.out.println(throwable.getMessage());
                            }
                        }
                );
    }


}
